package com.liheng.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import java.util.Map;

/**
 * @program: yygh_partn
 * @description:
 * @author: _LiHeng
 * @create: 2022-12-27 19:23
 **/
public class ExcelListener extends AnalysisEventListener<UserData> {
    //一行一行的去读取excel文件中的方法，从第二行开始读取
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }
    //可读取表头数据
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息：" + headMap);
    }

    /**
     * 读取之后在执行
     * @param analysisContext
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
